package com.hnas.trade.domain;

public enum TradeType {
	WXH5("0","微信H5"),
	LKL("1","拉卡拉POS机"),
	APP("2","APP"),
	H5("3","H5支付"),
	CCSM("4","乘车扫码");
	

	private String type;
	private String description;

	private TradeType(String type, String description) {
		this.type = type;
		this.description = description;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}
	
	public static TradeType getTradeType(String key) {
		         for (TradeType tradeType : TradeType.values()) {
		             if (tradeType.getType().equals(key)) {
		                return tradeType;
		            }
		         }
		 return null;
	 }
	
	public static String getTradeTypeString(String key) {
        return getTradeType(key)==null?"":getTradeType(key).getDescription();
   }

	
}
